<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<%@ include file="/common/meta.jsp" %>
<TITLE>金星财务管理系统</TITLE>
<link rel="stylesheet" type="text/css" href="${ctx}/css/smoothness/jquery-ui-1.8.14.custom.css">
<style type="text/css">
body {
 	 font-family: "Arial","Helvetica","Verdana","sans-serif"; font-size: 10px;
}
</style>
<script type="text/javascript" src="${ctx}/js/jquery-1.6.1.js"></script>
<script type="text/javascript" src="${ctx}/js/jquery-ui-1.8.14.custom.js"></script>
<script type="text/javascript">
$(document).ready(function () {
		$(function() {
			$( "#dialog-form" ).dialog({ 
				draggable: false
			});
		});
		
		$("#login").click(function(){	
		    $.ajax({  
		        url : 'login.html',  
		        data : $("#form1").serialize(),  
		        type : 'POST',  
		        dataType : 'json' ,
		        success : function(xht,status) {
		     	   //alert("登录成功 : " + xht.info);
		     	   if(xht.info.toString() == 'success')
		     	   {
		     	   			document.location.href = "${ctx}/home.html";
		     	   }else{
		     		  alert("用户名或密码错误:" + xht.info);
		     	   }
		        },
		        error : function(xht,status) {		        	
		     	   alert("登录出错 : " + xht);
		        }       
		    });
			
		});
});


$( ".button_selector" ).button();
</script>
</HEAD>
<BODY>
<div id="dialog-form" title="登录">
	<p class="validateTips"></p>
	<form id="form1">
		<P><label for="loginName">登录名</label>
		<input type="text" name="loginName" id="loginName" class="text ui-widget-content ui-corner-all" /></P>	
		<P><label for="password">密码</label>
		<input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" /></P>
		<P><input type="button" id="login" name="login" value="登录" class="button_selector"/>
		<input type="reset" value="清空" class="button_selector"/></P>
	</form>
</div>
</BODY>
</HTML>